Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dry-inflector, because Inflecto is no longer maintained #36

Closed
wants to merge 8 commits into from

Conversation

ahx
Copy link
Contributor

@ahx ahx commented Apr 9, 2019

This was done in two steps:

  1. Removing the class methods from Inflector
  2. Replacing dry-inflector instead of Inflecto

1 is good, because that way we can have different inflector settings per Store. 🤷‍♂️

@codecov
Copy link

codecov bot commented Apr 9, 2019

Codecov Report

Merging #36 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #36   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          36     36           
  Lines         740    747    +7     
=====================================
+ Hits          740    747    +7
Impacted Files Coverage Δ
lib/lurch.rb 100% <ø> (ø) ⬆️
lib/lurch/inflector.rb 100% <100%> (ø) ⬆️
lib/lurch/store.rb 100% <100%> (ø) ⬆️
lib/lurch/collection.rb 100% <100%> (ø) ⬆️
lib/lurch/relationship.rb 100% <100%> (ø) ⬆️
lib/lurch/relationship/has_one.rb 100% <100%> (ø) ⬆️
lib/lurch/resource.rb 100% <100%> (ø) ⬆️
lib/lurch/query.rb 100% <100%> (ø) ⬆️
lib/lurch/changeset.rb 100% <100%> (ø) ⬆️
lib/lurch/stored_resource.rb 100% <100%> (ø) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 07d56e0...7760469. Read the comment docs.

@ahx ahx force-pushed the dry-inflector branch from 096dd3d to 7e11430 Compare April 9, 2019 22:21
module Lurch
class Inflector
def initialize(inflection_mode, types_mode)
@inflector = Dry::Inflector.new do |inflections|
inflections.plural "people", "people"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this configuration required here? Would we need a way to expose custom pluralization rules to the end-user?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was basically added only to make the tests run. Apparently dry-inflector does pluralize a little different than Inflecto.
Yes, customizing the Inflector seems to be necessary.
However, I think we should also reduce the number of calls to a minimum, because this seems to be a big performance hit (#37) or remove the inflector completely. Both seems to be out of scope for this PR.

@ahx ahx closed this Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants